home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume89 / comm / vt100r29.8 < prev    next >
Internet Message Format  |  1989-10-20  |  67KB

  1. Path: xanth!ginosko!gem.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!newstop!sun!swap!page
  2. From: page%swap@Sun.COM (Bob Page)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v89i185:  vt100 - terminal emulator v2.9, Part08/09
  5. Message-ID: <126582@sun.Eng.Sun.COM>
  6. Date: 20 Oct 89 06:10:39 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1986
  9. Approved: page@sun.com
  10.  
  11. Submitted-by: acs@pccuts.pcc.amdahl.com (Tony Sumrall)
  12. Posting-number: Volume 89, Issue 185
  13. Archive-name: comm/vt100r29.8
  14.  
  15. # This is a shell archive.
  16. # Remove anything above and including the cut line.
  17. # Then run the rest of the file through 'sh'.
  18. # Unpacked files will be owned by you and have default permissions.
  19. #----cut here-----cut here-----cut here-----cut here----#
  20. #!/bin/sh
  21. # shar: SHell ARchive
  22. # Run the following text through 'sh' to create:
  23. #    vt100.c
  24. #    vt100.doc
  25. # This is archive 8 of a 9-part kit.
  26. # This archive created: Thu Oct 19 22:30:34 1989
  27. echo "extracting vt100.c"
  28. sed 's/^X//' << \SHAR_EOF > vt100.c
  29. X/********************************************************************
  30. X *  vt100 terminal emulator with xmodem transfer capability
  31. X *        :ts=8
  32. X *
  33. X *    v2.9 ACS - Only strip parity if parity is enabled; handle external xfer
  34. X *           items in handle_menupick(); new p_interlace value (2).
  35. X *    v2.8a 880331 ACS - Don't ReplyMsg too soon.
  36. X *    v2.7 870825 ACS - Provide handling of the msgs from the
  37. X *              info/status window.
  38. X *    v2.6 870227 DBW - bug fixes for all the stuff in v2.5
  39. X *    v2.5 870214 DBW - more additions (see readme file)
  40. X *    v2.4 861214 DBW - lots of fixes/additions (see readme file)
  41. X *    v2.3 861101 DBW - minor bug fixes
  42. X *    v2.2 861012 DBW - more of the same
  43. X *    v2.1 860915 DBW - new features (see README)
  44. X *         860901 ACS - Added Parity and Word Length and support code
  45. X *         860823 DBW - Integrated and rewrote lots of code
  46. X *    v2.0 860809 DBW - Major rewrite
  47. X *    v1.1 860720 DBW    - Switches, 80 cols, colors, bug fixes
  48. X *    v1.0 860712 DBW    - First version released
  49. X *
  50. X *  use <esc> to abort xmodem or kermit transfers
  51. X *
  52. X *  written by Michael Mounier
  53. X *  new version by Dave Wecker
  54. X *******************************************************************/
  55. X
  56. X/*  all includes defines and globals */
  57. X#include "vt100.h"
  58. X
  59. XAPTR OrigWindowPtr;    /* Used by init.c when opening a new screen */
  60. X
  61. X/**************************************************************/
  62. X/* here are all the global definitions that appear in vt100.h */
  63. X/**************************************************************/
  64. X
  65. Xint    CmdFromRexx = 0;
  66. X
  67. X#if AREXX
  68. Xstruct MsgPort *FromRexxPort = NULL;
  69. Xchar    *HostName;
  70. Xextern int    RexxReplies;
  71. X#endif /* AREXX */
  72. X
  73. Xchar    *bufr;
  74. Xint     fd, timeout = FALSE, ttime;
  75. Xint    multi = FALSE, server;
  76. X
  77. Xlong    bytes_xferred;
  78. Xchar    MyDir[60];
  79. XBPTR    StartLock = 0;
  80. Xstruct    IntuitionBase *IntuitionBase;
  81. Xstruct    GfxBase *GfxBase;
  82. Xstruct    Library *DiskfontBase;
  83. X
  84. X#if AREXX
  85. Xstruct    RxsLib  *RexxSysBase;
  86. X#endif    /* AREXX */
  87. X
  88. Xstruct    TextAttr myattr = {
  89. X    (STRPTR)(&(myfontname[0])),
  90. X    8,
  91. X    0,
  92. X    0};
  93. Xstruct    TextFont *myfont = NULL;
  94. Xstruct NewScreen NewScreen = {
  95. X   0,0,640,200,1,        /* left, top, width, height, depth */
  96. X   0,1,HIRES,            /* DetailPen, BlockPen, ViewModes */
  97. X   CUSTOMSCREEN,&myattr,    /* Type, Font */
  98. X   (UBYTE *)"VT100",        /* Title */
  99. X   NULL,NULL };            /* Gadgets, Bitmap */
  100. Xstruct NewWindow NewWindow = {
  101. X   0,0,640,200,            /* left, top, width, height */
  102. X   0,1,                /* detailpen, blockpen */
  103. X   MENUPICK | CLOSEWINDOW | RAWKEY | ACTIVEWINDOW | INACTIVEWINDOW | MOUSEBUTTONS,
  104. X   SMART_REFRESH | ACTIVATE | BORDERLESS | WINDOWCLOSE | WINDOWDEPTH | WINDOWDRAG,
  105. X   NULL,NULL,            /* FirstGadget, CheckMark */
  106. X   (UBYTE *)NULL,
  107. X   NULL,            /* set screen after open screen */
  108. X   NULL,            /* bitmap */
  109. X   640, 200, 640, 200,        /* minw, minh, maxw, maxh */
  110. X   CUSTOMSCREEN            /* Type */
  111. X   };
  112. X
  113. X/*   LeftEdge, TopEdge, Width and Height are in CHARACTERS.  They are
  114. X** converted to pixels in OpenReqWindow() in window.c based on the current
  115. X** font's characteristics. */
  116. Xstruct NewWindow NewReqWindow = {
  117. X   0, 1, 54, 4,            /* left (set in window.c), top, width, height */
  118. X   0, 1,            /* detailpen, blockpen */
  119. X    /* IDCMP Flags... */
  120. X   CLOSEWINDOW | ACTIVEWINDOW | REQCLEAR | REQSET | NEWSIZE,
  121. X    /* Flags... */
  122. X   SMART_REFRESH | NOCAREREFRESH | ACTIVATE | WINDOWSIZING | SIZEBRIGHT |
  123. X   WINDOWCLOSE | WINDOWDEPTH | WINDOWDRAG,
  124. X
  125. X   NULL,            /* First gadget */
  126. X   NULL,            /* CheckMark */
  127. X   (UBYTE *)"VT100 Info & Xfer Status",    /* Title */
  128. X   NULL,            /* set screen after open screen */
  129. X   NULL,            /* bitmap */
  130. X   ((5*8)+4+18), ((1*8)+11+2), 640, 200,    /* minw, minh, maxw, maxh */
  131. X   CUSTOMSCREEN            /* Type */
  132. X   };
  133. Xstruct IntuiText MyTitle = {
  134. X    0,1,JAM2,26,0,        /* front pen, back pen, mode, left, top */
  135. X    &myattr,            /* font */
  136. X    (UBYTE *)VERSION,        /* title */
  137. X    NULL};            /* next text */
  138. X
  139. Xstruct Screen *myscreen = NULL;        /* ptr to applications screen */
  140. Xstruct Window *mywindow = NULL;        /* ptr to applications window */
  141. Xstruct Window *reqwindow = NULL;    /* ptr to requester's window */
  142. Xstruct ViewPort *myviewport;
  143. Xstruct RastPort *myrastport;
  144. Xstruct IntuiMessage *NewMessage;    /* msg structure for GetMsg() */
  145. Xstruct Preferences  *Prefs;        /* preferences from GetPrefs() */
  146. X
  147. X/**** String requester support ******/
  148. X/*   The Top, Left, Width and Height are all in CHARACTERS.  This is converted
  149. X** to pixels in OpenReqWindow() in window.c.  Things which contain strings of
  150. X** known length are initialized from their string length */
  151. X
  152. Xchar    InpBuf[MAXGADSTR],UndoBuf[MAXGADSTR],Prompt[MAXGADSTR];
  153. Xstruct IntuiText donetxt = {
  154. X    1,0,JAM2,0,0,    /* front pen, back pen, mode, left, top */
  155. X    &myattr,        /* font */
  156. X    (UBYTE *)"DONE",    /* question to ask */
  157. X    NULL};        /* next text */
  158. Xstruct Gadget mydonegad = {
  159. X    &mystrgad,36,0,0,1,    /* next,left,top,width,height */
  160. X    GADGHCOMP|REQGADGET,    /* flags */
  161. X    RELVERIFY|ENDGADGET,    /* activation */
  162. X    BOOLGADGET,            /* gadget type */
  163. X    NULL,NULL,&donetxt,        /* gad render, sel render, gad text */
  164. X    0L,NULL,2,NULL};        /* mutual exclude, special, ID, user data */
  165. Xstruct    StringInfo mystrinfo = {
  166. X    (UBYTE *)InpBuf,
  167. X    (UBYTE *)UndoBuf,
  168. X    0,MAXGADSTR-1,0,0,0,0,    /* initial, max, disp, undo, #chrs, dsp chrs */
  169. X    0,0,NULL,0L,NULL};    /* left,top,layer,longint,keymap */
  170. Xstruct Gadget mystrgad = {
  171. X    NULL,1,1,40,1,    /* next,left,top,width,height */
  172. X    GADGHCOMP|REQGADGET,/* flags */
  173. X    ENDGADGET,STRGADGET,/* activation, type */
  174. X    NULL,NULL,NULL,    /* gad render, sel render, gad text */
  175. X    0L,            /* mutual exclude */
  176. X    (APTR)&mystrinfo,    /* special info */
  177. X    1,NULL};        /* gadget ID, user data */
  178. Xstruct IntuiText mystrtxt= {
  179. X    0,1,JAM2,1,0,    /* front pen, back pen, mode, left, top */
  180. X    &myattr,        /* font */
  181. X    (UBYTE *)Prompt,    /* question to ask */
  182. X    NULL};        /* next text */
  183. Xstruct Requester myrequest = {
  184. X    NULL,0,1,42,2,    /* older requester, left, top, width, height */
  185. X    0,0,&mydonegad,    /* relleft reltop, gadgets */
  186. X    NULL,        /* border */
  187. X    &mystrtxt,        /* text */
  188. X    NULL,1,NULL,    /* flags, back fill pen, layer */
  189. X    {0,0,0,0,0,0,0,0,
  190. X     0,0,0,0,0,0,0,0,
  191. X     0,0,0,0,0,0,0,0,
  192. X     0,0,0,0,0,0,0,0},    /* pad1 */
  193. X    NULL,NULL,        /* image bit map, rquest window */
  194. X    {0,0,0,0,0,0,0,0,0,
  195. X     0,0,0,0,0,0,0,0,0,
  196. X     0,0,0,0,0,0,0,0,0,
  197. X     0,0,0,0,0,0,0,0,0} /* pad2 */
  198. X    };
  199. X
  200. Xint numreqs = 0;        /* number of outstanding requestors */
  201. Xint reqwinup = 0;        /* Requester window is NOT displayed */
  202. Xextern int reqmaxx, reqmaxy, reqmaxlen;    /* Defined in window.c */
  203. Xextern void ReqNewSize();    /* New req window size -- window.c */
  204. Xextern void KillReq();        /* Kill requester window in window.c */    
  205. X
  206. Xstruct ExternalXfer *(ExtXfer[EXTMAX]);    /* Possible external protocol routines */
  207. Xint NumExts = 0;            /* Number of ExtXfers */
  208. X
  209. X/***** menu structures *****/
  210. Xstruct MenuItem FileItem[FILEMAX];
  211. Xstruct IntuiText FileText[FILEMAX];
  212. Xstruct MenuItem ModeItem[MODEMAX+EXTMAX];
  213. Xstruct IntuiText ModeText[MODEMAX+EXTMAX];
  214. Xstruct MenuItem CommItem[COMMAX];
  215. Xstruct IntuiText CommText[COMMAX];
  216. Xstruct MenuItem RSItem[RSMAX];
  217. Xstruct IntuiText RSText[RSMAX];
  218. Xstruct MenuItem ParItem[PARMAX];
  219. Xstruct IntuiText ParText[PARMAX];
  220. Xstruct MenuItem XFItem[XFMAX];
  221. Xstruct IntuiText XFText[XFMAX];
  222. Xstruct MenuItem ScriptItem[SCRIPTMAX];
  223. Xstruct IntuiText ScriptText[SCRIPTMAX];
  224. Xstruct MenuItem UtilItem[UTILMAX];
  225. Xstruct IntuiText UtilText[UTILMAX];
  226. Xstruct Menu menu[MAXMENU];
  227. Xstruct IOExtSer *Read_Request;
  228. Xchar *rs_in;
  229. Xstruct IOExtSer *Write_Request;
  230. Xchar rs_out[2];
  231. Xstruct timerequest Timer;
  232. Xstruct MsgPort *Timer_Port = NULL;
  233. Xstruct timerequest Script_Timer;
  234. Xstruct MsgPort *Script_Timer_Port = NULL;
  235. Xstruct IOAudio Audio_Request;
  236. Xstruct MsgPort *Audio_Port = NULL;
  237. XUBYTE  *BeepWave;
  238. XUBYTE  Audio_AllocMap[4] = { 1, 8, 2, 4 };
  239. Xint x,y,curmode;
  240. Xint Xsize    = 0;    /* From struct TextFont for user's font */
  241. Xint MINX    = 0;
  242. Xint MAXX    = 632;
  243. Xint Ysize    = 0;    /* From struct TextFont for user's font */
  244. Xint MINY    = 14;
  245. Xint MAXY    = 198;
  246. Xint BaseLine    = 0;    /* From struct TextFont for user's font */
  247. Xint top        = 14;
  248. Xint bot        = 198;
  249. Xint savx    = 0;
  250. Xint savy    = 14;
  251. Xint savmode    = 0;
  252. Xint nlmode    = 0;
  253. Xint alt        = 0;
  254. Xint savalt    = 0;
  255. Xint a[2]    = { 0, 0 };
  256. Xint sa[2]    = { 0, 0 };
  257. Xint  inesc    = -1;
  258. Xint  inctrl    = -1;
  259. Xint  private    = 0;
  260. Xint  badseq    = 0;
  261. Xint  maxcol    = 79;
  262. X
  263. X/*************************** defaults *******************************/
  264. Xchar    *p_font        = "topaz";    /* Default font. Name must be < 34 chars */
  265. Xchar    *p_device    = SERIALNAME;    /* Default serial device name to use */
  266. Xint    p_fontsize    = 8;    /* Default vertical font size        */
  267. Xint    p_baud        = 1200;    /* baud rate                */
  268. Xint    p_shared    = 1;    /* Open serial device in shared mode    */
  269. Xint    p_screen    = 0;    /* 0 = WORKBENCH, 1 = CUSTOM        */
  270. Xint    p_wbcolors    = 1;    /* 0 = Custom, 1 = Workbench colors    */
  271. Xint    p_interlace    = 2;    /* 0 = no interlace, 1 = interlace, 2 = ASIS */
  272. Xint    p_depth        = 2;    /* number of bit planes (1 or 2)    */
  273. Xint    p_foreground    = 0x840;    /* default foreground RGB color */
  274. Xint    p_background    = 0x000;    /* default background RGB color */
  275. Xint    p_bold        = 0x000;    /* default BOLD       RGB color */
  276. Xint    p_cursor    = 0x00d;    /* default Cursor      RGB color */
  277. Xint    p_mouse_up    = 0;    /* 1 = send mouse UP events        */
  278. Xint    p_mouse_down    = 0;    /* 1 = send mouse DOWN events        */
  279. Xint    p_lines        = 0;    /* 0 == use all available (MoreRows)    */
  280. Xint    p_mode        = 0;    /* 0 = image, 1 = CRLF (for kermit)    */
  281. Xint    p_unit        = 0;    /* unit of serial.device to open    */
  282. Xint    p_xproto    = 3;    /* 0=ASCII, 1=Xmodem, 2=XmodemCRC, 3 = Kermit */
  283. Xint    p_buffer    = 512;    /* read buffer size (>= 512 bytes)    */
  284. Xint     p_parity    = 0;    /* 0=none,1=mark,2=space,3=even,4=odd    */
  285. Xlong    p_break        = 750000;    /* break time (in micro seconds)*/
  286. Xint    p_volume    = 64;    /* beep volume (0 = DisplayBeep)    */
  287. Xint    p_wrap        = 1;    /* 0 = truncate, 1 = wrap long lines    */
  288. Xint    p_keyapp    = 0;    /* 0 = numeric, 1 = application keypad    */
  289. Xint    p_curapp    = 0;    /* 0 = cursor, 1 = application cursor    */
  290. Xint    p_echo        = 0;    /* 0 = full duplex, 1 = half duplex    */
  291. Xint    p_bs_del    = 0;    /* 0 = normal, 1 = swap bs and delete    */
  292. Xint    p_convert    = 0;    /* 1 = convert filenames to lower case    */
  293. Xint    p_autochop    = 1;    /* 1 = enable xmodem autochop        */
  294. Xint    p_kmaxpack    = 1000;    /* Max packet size for Kermit xfers    */
  295. X/*    Must be <= 1000.  <= 94 is standard, > 94 requires a kermit capable
  296. X**    of long packet support. */
  297. Xint    p_xbeep        = 1;    /* 1 = beep at end of xfer        */
  298. Xchar    p_keyscript    = 0x7E;    /* function key script introducer = ~    */
  299. Xchar    *p_f[11]    = {    /* function key defaults and mouse prefix */
  300. X    "\033OP","\033OQ","\033OR","\033OS",
  301. X    "f5","f6","f7","f8","f9","f10",
  302. X    "\033M" /* Mouse prefix here */ };
  303. X
  304. Xchar    *p_F[10]     = {        /* shifted function key defaults    */
  305. X    "F1","F2","F3","F4","F5",
  306. X    "F6","F7","F8","F9","F10"};
  307. X
  308. Xchar myfontname[FONTNAMESIZE];
  309. Xchar mysername[SERNAMESIZE];
  310. X
  311. X/* for script file */
  312. Xextern char on_string[], wait_string[];
  313. Xint script_on, script_wait;
  314. Xint doing_init = 0;
  315. X
  316. X/******************************************************/
  317. X/*                   Main Program                     */
  318. X/*                                                    */
  319. X/*      This is the main body of the program.         */
  320. X/******************************************************/
  321. X
  322. Xchar lookahead[80];
  323. XFILE *tranr = NULL;
  324. XFILE *trans = NULL;
  325. Xint capture,send;
  326. Xchar XferredFileName[MAXGADSTR];/* Name of last transferred file    */
  327. Xchar ScriptFileName[MAXGADSTR];    /* Name of last script file        */
  328. Xchar DirName[MAXGADSTR];    /* Name of last directory        */
  329. Xstruct MsgPort *mySerPort;
  330. X
  331. X#if AREXX
  332. Xint forwarding = 0;        /* Forwarding received data to AREXX    */
  333. Xchar *ForwardPortName;        /* Port name to which we forward data    */
  334. Xstruct RexxMsg *FwdMsg;        /* Message to send            */
  335. Xchar *extension = "vt100";    /* extension of VT100 AREXX macros    */
  336. X#endif /* AREXX */
  337. X
  338. Xvoid
  339. Xmain(argc,argv)
  340. Xint    argc;
  341. Xchar    **argv;
  342. X    {
  343. X    ULONG class, waitmask, redo = 0;
  344. X    unsigned int code, qual;
  345. X    SHORT mouse_x, mouse_y, mouse_qual;
  346. X    APTR iaddr;
  347. X#if AREXX
  348. X    struct RexxMsg *RexxMsg;
  349. X    char    fwdchars[256];
  350. X#endif /* AREXX */
  351. X    int KeepGoing,i,la,dola,actual, len;
  352. X    char c,*ptr;
  353. X    char ascstr[100];    /* Area for string returned by toasc() */
  354. X
  355. X    XferredFileName[0] = ScriptFileName[0] = '\0';
  356. X
  357. X    ptr = InitDefaults(argc,argv);
  358. X    InitDevs();
  359. X    InitFileItems();
  360. X    InitCommItems();
  361. X    InitScriptItems();
  362. X    InitUtilItems();
  363. X    InitMenu();
  364. X    SetMenuStrip(mywindow,&menu[0]);
  365. X    PrintIText(mywindow->RPort,&MyTitle,0L,0L);
  366. X
  367. X    MyDir[0]  =        '\0';
  368. X    StartLock = ((struct Process *) FindTask(NULL))->pr_CurrentDir;
  369. X    CurrentDir(DupLock(StartLock));
  370. X    KeepGoing =        TRUE;
  371. X    capture   =        FALSE;
  372. X    send      =        FALSE;
  373. X    maxcol    =        MAXX / Xsize;
  374. X    la          =        0;
  375. X    x          =        MINX ;
  376. X    y          =        MINY;
  377. X    curmode   =        FS_NORMAL;
  378. X    script_on =     FALSE;
  379. X    script_wait=    TRUE;
  380. X    on_string[0] = wait_string[0] = '\0';
  381. X    SetAPen(mywindow->RPort,1L);
  382. X    cursorflip();
  383. X    cursorflip();
  384. X    emit(12);
  385. X    mySerPort = Read_Request->IOSer.io_Message.mn_ReplyPort;
  386. X    SendIO((struct IORequest *)Read_Request);
  387. X
  388. X    /* see if we had a startup script */
  389. X    if (ptr != NULL) script_start(ptr);
  390. X
  391. X    while( KeepGoing ) {
  392. X    /* wait for window message or serial port message */
  393. X    cursorflip();
  394. X    waitmask = (1L << mySerPort->mp_SigBit) |
  395. X           (1L << mywindow->UserPort->mp_SigBit) |
  396. X           (1L << Script_Timer_Port->mp_SigBit);
  397. X
  398. X    if(reqwinup)
  399. X        waitmask |= (1L << reqwindow->UserPort->mp_SigBit);
  400. X
  401. X#if AREXX
  402. X    if(FromRexxPort)
  403. X        waitmask |= (1L << FromRexxPort->mp_SigBit);
  404. X#endif /* AREXX */
  405. X
  406. X    if (script_wait)    /* if script ready dont wait here */
  407. X        Wait(waitmask);
  408. X    cursorflip();
  409. X
  410. X    /* do ascii file send */
  411. X    if (send) {
  412. X        if ((c=getc(trans)) != EOF) {
  413. X        if (c == '\n')
  414. X            c = '\r';
  415. X        sendchar(c);
  416. X        } else {
  417. X            fclose(trans);
  418. X            InfoMsg1Line("File Sent");
  419. X            send=FALSE;
  420. X        }
  421. X    }
  422. X
  423. X    /* see if there are any characters from the host */
  424. X    if (CheckIO((struct IORequest *)Read_Request)) {
  425. X        register int fwdndx = 0;
  426. X        struct MsgPort *FwdPort;
  427. X
  428. X        WaitIO((struct IORequest *)Read_Request);
  429. X        c = rs_in[0] & (p_parity ? 0x7F : 0xFF);
  430. X#if AREXX
  431. X        fwdchars[fwdndx++] = c;
  432. X#endif
  433. X        doremote(c);
  434. X        if (*on_string || *wait_string)
  435. X        chk_script(c);
  436. X        if (capture && c != 10) {
  437. X        if (c == 13) c = 10;
  438. X        putc(c , tranr);
  439. X        }
  440. X        Read_Request->IOSer.io_Command = SDCMD_QUERY;
  441. X        DoIO((struct IORequest *)Read_Request);
  442. X        Read_Request->IOSer.io_Command = CMD_READ;
  443. X        actual = (int)Read_Request->IOSer.io_Actual;
  444. X        if (actual > 0) {
  445. X        if (inesc   <  0 &&
  446. X            inctrl  <  0 &&
  447. X            a[alt]  == 0 &&
  448. X            capture == FALSE)
  449. X                dola = 1;
  450. X        else
  451. X            dola = 0;
  452. X        Read_Request->IOSer.io_Length =
  453. X        Read_Request->IOSer.io_Actual;
  454. X        DoIO((struct IORequest *)Read_Request);
  455. X        Read_Request->IOSer.io_Length = 1;
  456. X
  457. X        for (i = 0; i < actual; i++) {
  458. X            c=rs_in[i] & (p_parity ? 0x7f : 0xff);
  459. X#if AREXX
  460. X            if(fwdndx < 255)
  461. X            fwdchars[fwdndx++] = c;
  462. X#endif
  463. X            if (*on_string || *wait_string)
  464. X            chk_script(c);
  465. X
  466. X            if (dola == 1) {
  467. X            if (c >= ' ' && c <= '~' && la < 80)
  468. X                lookahead[la++] = c;
  469. X            else {
  470. X                if (la > 0) {
  471. X                emitbatch(la,lookahead);
  472. X                la = 0;
  473. X                }
  474. X                doremote(c);
  475. X                dola = 0;
  476. X            }
  477. X            } else {
  478. X            doremote(c);
  479. X            if (inesc   <  0 &&
  480. X                inctrl  <  0 &&
  481. X                a[alt]  == 0 &&
  482. X                capture == FALSE)
  483. X                dola = 1;
  484. X            if (capture && c != 10) {
  485. X                if (c == 13) c = 10;
  486. X                putc(c , tranr);
  487. X            }
  488. X            }
  489. X        }
  490. X
  491. X        /* dump anything left in the lookahead buffer */
  492. X        if (la > 0) {
  493. X            emitbatch(la,lookahead);
  494. X            la = 0;
  495. X        }
  496. X        }
  497. X#if AREXX
  498. X        if(forwarding && fwdndx) {
  499. X        fwdchars[fwdndx] = '\0';
  500. X        Forbid();
  501. X        /*   Since forwarding is set we can assume that the AREXX
  502. X        ** library is available.  This is assured in cmd_fwd() in
  503. X        ** script.c
  504. X        **/
  505. X        if( ((FwdPort = FindPort(ForwardPortName)) != NULL)
  506. X         && (FwdMsg = CreateRexxMsg(FromRexxPort, extension, HostName))
  507. X         && (ARG0(FwdMsg) = (STRPTR)CreateArgstring(fwdchars, (LONG)fwdndx)) ) {
  508. X            ARG1(FwdMsg) = (STRPTR)1;
  509. X            FwdMsg->rm_Action = RXCOMM;
  510. X            PutMsg(FwdPort, (struct Message *)FwdMsg);
  511. X            RexxReplies++;
  512. X        }
  513. X        Permit();
  514. X        }
  515. X#endif /* AREXX */
  516. X        SendIO((struct IORequest *)Read_Request);
  517. X     }
  518. X
  519. X    while((NewMessage =
  520. X        (struct IntuiMessage *)GetMsg(mywindow->UserPort))
  521. X            != FALSE) {
  522. X
  523. X        class = NewMessage->Class;
  524. X        code = NewMessage->Code;
  525. X        qual = NewMessage->Qualifier;
  526. X        mouse_x = NewMessage->MouseX;
  527. X        mouse_y = NewMessage->MouseY;
  528. X        if(class == RAWKEY)
  529. X        iaddr = *((APTR *)NewMessage->IAddress);
  530. X        else
  531. X        ReplyMsg((struct Message *)NewMessage);
  532. X        switch( class ) {
  533. X        case CLOSEWINDOW:
  534. X        KeepGoing = FALSE;
  535. X        break;
  536. X
  537. X        case RAWKEY:
  538. X        len = toasc(&(ascstr[0]), code,qual, 100, iaddr, 0);
  539. X        ReplyMsg((struct Msg *)NewMessage);
  540. X        if (p_echo) {
  541. X            ptr = &(ascstr[0]);
  542. X            for(i = 0; i < len; i++)
  543. X            doremote(*(ptr++));
  544. X        }
  545. X        break;
  546. X
  547. X        case NEWSIZE:
  548. X        emit(12);
  549. X        break;
  550. X
  551. X        case MENUPICK:
  552. X        while(code != MENUNULL) {
  553. X            struct MenuItem *Item =
  554. X            ItemAddress(mywindow->MenuStrip, (long)code);
  555. X            unsigned int newcode =
  556. X            (Item ? Item->NextSelect : code);
  557. X
  558. X            redo |= handle_menupick(class,code);
  559. X            if(code == newcode)
  560. X            code = MENUNULL;
  561. X            else
  562. X            code = newcode;
  563. X        }
  564. X        if(redo & REDOFILE)
  565. X            redofile();
  566. X        if(redo & REDOCOMM)
  567. X            redocomm();
  568. X        if(redo & REDOUTIL)
  569. X            redoutil();
  570. X        redo = 0;
  571. X        break;
  572. X
  573. X        case MOUSEBUTTONS:
  574. X        if((p_mouse_down && (code == SELECTDOWN))
  575. X        || (p_mouse_up   && (code == SELECTUP)) ) {
  576. X            mouse_qual = 0;
  577. X            if (qual & IEQUALIFIER_CONTROL)
  578. X            mouse_qual |= 1;
  579. X            if (qual & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT))
  580. X            mouse_qual |= 2;
  581. X            if (qual & (IEQUALIFIER_LALT | IEQUALIFIER_RALT))
  582. X            mouse_qual |= 4;
  583. X            if (qual & (IEQUALIFIER_CAPSLOCK))
  584. X            mouse_qual |= 8;
  585. X            mouse_qual |= (code == SELECTDOWN) ? 16 : 32;
  586. X
  587. X            sendstring(p_f[10]);
  588. X            sendchar(mouse_qual + '@');
  589. X            sendchar(' ' + ((mouse_x - MINX) / 8),10);  /* column */
  590. X            sendchar(' ' + ((mouse_y - MINY + 6 ) / 8),10);/* row */
  591. X        }
  592. X        break;
  593. X
  594. X        default:
  595. X        PrintIText(mywindow->RPort,&MyTitle,0L,0L);
  596. X        break;
  597. X        }   /* end of switch (class) */
  598. X    }   /* end of while ( newmessage )*/
  599. X
  600. X    if (!script_wait ||
  601. X       (CheckIO((struct IORequest *)&Script_Timer) &&
  602. X        script_wait == WAIT_TIMER))
  603. X        do_script_cmd(NEXTCOMMAND);
  604. X
  605. X    while( reqwinup && ((NewMessage = (struct IntuiMessage *)
  606. X                  GetMsg(reqwindow->UserPort)) != FALSE)
  607. X         ) {
  608. X        class = NewMessage->Class;
  609. X        ReplyMsg((struct Msg *)NewMessage);
  610. X        switch( class ) {
  611. X        case REQCLEAR:
  612. X        numreqs = 0;
  613. X        break;
  614. X
  615. X        case CLOSEWINDOW:
  616. X        KillReq(); /* Kills requester window, set reqwinup = 0 */
  617. X        break;
  618. X
  619. X        case NEWSIZE:
  620. X        ReqNewSize(reqwindow->Height, reqwindow->Width);
  621. X        break;
  622. X        }   /* end of switch (class) */
  623. X    } /* end while reqwinup */
  624. X#if AREXX
  625. X    while(FromRexxPort && (RexxMsg = (struct RexxMsg *)GetMsg(FromRexxPort)) != NULL) {
  626. X        processrexxmsg(RexxMsg);
  627. X    }
  628. X#endif /* AREXX */
  629. X    }  /* end while ( keepgoing ) */
  630. X
  631. X    /*   It must be time to quit, so we have to clean
  632. X    **   up and exit.
  633. X    */
  634. X
  635. X    if(!CheckIO((struct IORequest *)Read_Request))
  636. X    AbortIO((struct IORequest *)Read_Request);
  637. X    Wait (1L <<mySerPort->mp_SigBit);
  638. X    WaitIO((struct IORequest *)Read_Request);
  639. X    cleanup("",0);
  640. X
  641. X} /* end of main */
  642. X
  643. X/* cleanup code */
  644. Xvoid
  645. Xcleanup(reason, fault)
  646. Xchar *reason;
  647. Xint fault;
  648. X{
  649. X    extern struct Device *ConsoleDevice;    /* In init.c */
  650. X    extern struct IOStdReq ConReq;        /* In init.c */
  651. X    int i;
  652. X
  653. X    switch(fault) {
  654. X    case 0:        /* quitting close everything */
  655. X    KillReq();    /* Kill the requester and its window */
  656. X    ClearMenuStrip( mywindow );
  657. X    CloseDevice((struct IORequest *)&Audio_Request);
  658. X    UnLock(CurrentDir(StartLock));    /* back to original directory */
  659. X
  660. X    case 8:        /* error opening audio */
  661. X    DeletePort(Audio_Port);
  662. X    FreeMem(BeepWave,BEEPSIZE);
  663. X    CloseDevice((struct IORequest *)&Timer);
  664. X
  665. X    case 7:        /* error opening timer */
  666. X    DeletePort(Timer_Port);
  667. X    CloseDevice((struct IORequest *)&Script_Timer);
  668. X    DeletePort(Script_Timer_Port);
  669. X
  670. X/*    case 6: */    /* error opening write device is unused */
  671. X    DeletePort(Write_Request->IOSer.io_Message.mn_ReplyPort);
  672. X    FreeMem(Write_Request,(long)sizeof(*Write_Request));
  673. X    CloseDevice((struct IORequest *)Read_Request);
  674. X
  675. X    case 5:        /* error opening read device */
  676. X    DeletePort(Read_Request->IOSer.io_Message.mn_ReplyPort);
  677. X    FreeMem(Read_Request,(long)sizeof(*Read_Request));
  678. X
  679. X    case 4:        /* error opening window */
  680. X    if (ConsoleDevice != NULL)
  681. X        CloseDevice(&ConReq);
  682. X    if (myfont   != NULL)
  683. X        CloseFont( myfont );
  684. X    if (mywindow != NULL)
  685. X        CloseWindow( mywindow );
  686. X    if (p_screen && myscreen) {
  687. X        struct Process *mproc;
  688. X
  689. X        mproc = (struct Process *)FindTask(0L);
  690. X        mproc->pr_WindowPtr = OrigWindowPtr;
  691. X        CloseScreen( myscreen );
  692. X    }
  693. X    for(i = 0; i < NumExts; i++) {
  694. X        struct ExternalXfer *xfer = ExtXfer[i];
  695. X
  696. X        FreeMem(xfer->dispname, (long)(strlen(xfer->dispname)+1));
  697. X        FreeMem(xfer->downname, (long)(strlen(xfer->downname)+1));
  698. X        FreeMem(xfer->send, (long)(strlen(xfer->send)+1));
  699. X        FreeMem(xfer->receive, (long)(strlen(xfer->receive)+1));
  700. X        FreeMem(xfer, (long)sizeof(struct ExternalXfer));
  701. X    }        
  702. X
  703. X    case 3:        /* error opening screen */
  704. X    case 2:        /* error opening graphics library */
  705. X    if(GfxBase)
  706. X        CloseLibrary((struct Library *)GfxBase);
  707. X    if(DiskfontBase)
  708. X        CloseLibrary(DiskfontBase);
  709. X    case 1:        /* error opening intuition */
  710. X    if(IntuitionBase)
  711. X        CloseLibrary((struct Library *)IntuitionBase);
  712. X    default:
  713. X    if (*reason) puts (reason);
  714. X    }
  715. X
  716. X#if AREXX
  717. X    if(HostName)
  718. X    FreeMem(HostName, (LONG)(strlen(HostName)+1));
  719. X
  720. X    if(FromRexxPort) {
  721. X    RemPort(FromRexxPort);
  722. X    FreePort(FromRexxPort);
  723. X    FreeMem(FromRexxPort, (LONG)sizeof(struct MsgPort));
  724. X    }
  725. X    if(RexxSysBase)
  726. X    CloseLibrary((struct Library *)RexxSysBase);
  727. X#endif /* AREXX */
  728. X    exit(fault);
  729. X}
  730. X
  731. Xdo_capture(file)
  732. Xchar *file;
  733. X{
  734. X    if (capture == TRUE) {
  735. X    capture=FALSE;
  736. X    fclose(tranr);
  737. X    InfoMsg1Line("End File Capture");
  738. X    } else {
  739. X    if (file == NULL || *file == '\0') {
  740. X        req("Ascii Capture:",XferredFileName,1);
  741. X    } else
  742. X        strcpy(XferredFileName, file);
  743. X    if ((tranr=fopen(XferredFileName,"w")) == 0) {
  744. X        capture=FALSE;
  745. X        InfoMsg2Line("Error Opening File:", XferredFileName);
  746. X        return(FALSE);
  747. X    }
  748. X    capture=TRUE;
  749. X    }
  750. X    redofile();
  751. X}
  752. X
  753. Xdo_send(file)
  754. Xchar *file;
  755. X{
  756. X    if (send == TRUE) {
  757. X    send=FALSE;
  758. X    fclose(trans);
  759. X    InfoMsg1Line("File Send Cancelled");
  760. X    } else {
  761. X    if (file == NULL || *file == '\0') {
  762. X        req("Ascii Send:", XferredFileName, 1);
  763. X    } else
  764. X        strcpy(XferredFileName, file);
  765. X    if ((trans=fopen(XferredFileName, "r")) == 0) {
  766. X        send=FALSE;
  767. X        InfoMsg2Line("Error Opening File:", XferredFileName);
  768. X        return(FALSE);
  769. X    }
  770. X    send=TRUE;
  771. X    }
  772. X}
  773. X
  774. Xvoid setparams()
  775. X{
  776. X    Read_Request->IOSer.io_Command =
  777. X    Write_Request->IOSer.io_Command =
  778. X        SDCMD_SETPARAMS;
  779. X    DoIO((struct IORequest *)Read_Request);
  780. X    DoIO((struct IORequest *)Write_Request);
  781. X    Read_Request->IOSer.io_Command = CMD_READ;
  782. X    SendIO((struct IORequest *)Read_Request);
  783. X    Write_Request->IOSer.io_Command = CMD_WRITE;
  784. X}
  785. X
  786. Xvoid hangup ()
  787. X    {
  788. X    if(!CheckIO((struct IORequest *)Read_Request))
  789. X    AbortIO((struct IORequest *)Read_Request);
  790. X    Wait (1L <<mySerPort->mp_SigBit);
  791. X    WaitIO((struct IORequest *)Read_Request);
  792. X    CloseDevice((struct IORequest *)Read_Request);
  793. X    Timer.tr_time.tv_secs=0L;
  794. X    Timer.tr_time.tv_micro=750000L;
  795. X    DoIO((struct IORequest *)&Timer.tr_node);
  796. X    OpenDevice(mysername, (LONG)p_unit, (struct IORequest *)Read_Request, NULL);
  797. X    setparams();
  798. X}
  799. X
  800. Xvoid redocomm() {
  801. X    ClearMenuStrip( mywindow );         /* Remove old menu */
  802. X    InitCommItems();                    /* Re-do comm menu   */
  803. X    SetMenuStrip(mywindow,&menu[0]);    /* Re-display the menu */
  804. X}
  805. X
  806. Xvoid redofile() {
  807. X    ClearMenuStrip( mywindow );         /* Remove old menu */
  808. X    InitFileItems();                    /* Re-do file menu   */
  809. X    SetMenuStrip(mywindow,&menu[0]);    /* Re-display the menu */
  810. X}
  811. X
  812. Xvoid setserbaud(baud, redomenu)
  813. Xint baud;
  814. XLONG redomenu;
  815. X{
  816. X    if(!CheckIO((struct IORequest *)Read_Request))
  817. X    AbortIO((struct IORequest *)Read_Request);
  818. X    Wait (1L <<mySerPort->mp_SigBit);
  819. X    WaitIO((struct IORequest *)Read_Request);
  820. X    Write_Request->io_Baud = Read_Request->io_Baud = baud;
  821. X    setparams();
  822. X    p_baud = baud;
  823. X    if (redomenu)
  824. X    redocomm();
  825. X}
  826. X
  827. Xvoid redoutil() {
  828. X    ClearMenuStrip(mywindow);
  829. X    InitUtilItems();
  830. X    SetMenuStrip(mywindow,&menu[0]);
  831. X}
  832. X
  833. XULONG handle_menupick(class, code)
  834. XULONG class;
  835. Xunsigned int code;
  836. X{
  837. X    unsigned int menunum, itemnum, subnum, i;
  838. X    int nxfer;
  839. X    unsigned long retval = 0;
  840. X
  841. X    if (code == MENUNULL)
  842. X    return retval;
  843. X
  844. X    menunum = MENUNUM( code );
  845. X    itemnum = ITEMNUM( code );
  846. X    subnum  = SUBNUM( code );
  847. X    switch( menunum ) {
  848. X    case 0:
  849. X    switch( itemnum ) {
  850. X    case 0:    /* menunum case 0 itemnum case 0 -- Set xfer mode */
  851. X        switch( subnum ) {
  852. X        case 0:    /* Ascii */
  853. X        case 1:    /* Xmodem */
  854. X        case 2:    /* XmodemCRC */
  855. X        case 3:    /* Kermit */
  856. X        i = subnum;
  857. X        break;
  858. X        default:
  859. X        nxfer = MODEMAX + NumExts - 1;
  860. X        if(subnum > nxfer)
  861. X            i = MODEMAX-1;
  862. X        else
  863. X            i = subnum;
  864. X        }
  865. X        p_xproto = i;
  866. X        retval |= REDOFILE;
  867. X        break;
  868. X
  869. X    case 1:    /* menunum case 0 itemnum case 1 -- Send a file */
  870. X        cmd_sendf(XferredFileName);
  871. X        break;
  872. X
  873. X    case 2:    /* menunum case 0 itemnum case 2 -- Receive a file */
  874. X        cmd_recf(XferredFileName);
  875. X        break;
  876. X
  877. X    case 3:    /* menunum case 0 itemnum case 3 -- Kermit GET */
  878. X        cmd_kg(XferredFileName);
  879. X        break;
  880. X
  881. X    case 4:    /* menunum case 0 itemnum case 4 -- Kermit BYE */
  882. X        saybye();
  883. X        break;
  884. X    case 5: /* menunum case 0 itemnum case 5 -- ASCII capture */
  885. X        do_capture(XferredFileName);
  886. X        break;
  887. X    } /* End of itemnum switch for menunum case 0 */
  888. X    break;
  889. X
  890. X    case 1:        /* menunum case 1 - Comm Setup */
  891. X    switch( itemnum ) {
  892. X    case 0:    /* Baud */
  893. X        switch( subnum ) {
  894. X        case 0:
  895. X        setserbaud(300, FALSE);
  896. X        break;
  897. X
  898. X        case 1:
  899. X        setserbaud(1200, FALSE);
  900. X        break;
  901. X
  902. X        case 2:
  903. X        setserbaud(2400, FALSE);
  904. X        break;
  905. X
  906. X        case 3:
  907. X        setserbaud(4800, FALSE);
  908. X        break;
  909. X
  910. X        case 4:
  911. X        setserbaud(9600, FALSE);
  912. X        break;
  913. X        } /* End of subnum switch for itemnum 0 of menunum 1 */
  914. X        break;
  915. X
  916. X    case 1:    /* menunum case 1 itemnum 1 -- Set  Parity */
  917. X        p_parity = subnum;
  918. X        break;
  919. X
  920. X    case 2:    /* menunum case 1 itemnum 2 -- set transfer mode */
  921. X        switch(subnum) {
  922. X        case 0:
  923. X        case 1:
  924. X        p_mode = subnum;
  925. X        break;
  926. X        case 2:
  927. X        if (p_convert)
  928. X            p_convert = 0;
  929. X        else
  930. X            p_convert = 1;
  931. X        break;
  932. X        case 3:
  933. X        if(p_autochop)
  934. X            p_autochop = 0;
  935. X        else
  936. X            p_autochop = 1;
  937. X        break;
  938. X        }
  939. X        retval |= REDOCOMM;
  940. X        break;
  941. X    case 3:   /* menunum case 1 itemnum 3 -- Shared */
  942. X        {
  943. X        char onoff[4];
  944. X
  945. X        if(p_shared)
  946. X            strcpy(onoff, "off");
  947. X        else
  948. X            strcpy(onoff, "on");
  949. X        cmd_share(onoff);
  950. X        }
  951. X        break;
  952. X    }
  953. X    break;    /* End of menunum case 1 */
  954. X
  955. X    case 2:    /* menunum case 2 - Script */
  956. X    switch( itemnum ) {
  957. X    case 0:            /* Execute macro    */
  958. X    case 1:            /* Abort macro        */
  959. X        if (!itemnum && !script_on) {
  960. X        req("Script file name:", ScriptFileName, 1);
  961. X        script_start(ScriptFileName);
  962. X        }
  963. X        if (itemnum && script_on)
  964. X        exit_script();
  965. X        break;
  966. X    case 2: {            /* AREXX macro        */
  967. X
  968. X        req("AREXX macro and args:", ScriptFileName, 1);
  969. X        cmd_rx(ScriptFileName);
  970. X        break;
  971. X        }
  972. X    }
  973. X    break;
  974. X
  975. X    case 3:    /* menunum case 3 -- Utility */
  976. X    switch( itemnum ) {
  977. X    case 0:
  978. X        sendbreak();
  979. X        break;
  980. X
  981. X    case 1:    /* menunum case 3 itemnum case 1 -- Hang Up */
  982. X        hangup();
  983. X        break;
  984. X
  985. X    case 2:    /* menunum case 3 itemnum case 2 -- Cd */
  986. X        strcpy(DirName, MyDir);
  987. X        req("Directory:", DirName, 1);
  988. X        set_dir(DirName);
  989. X        break;
  990. X
  991. X    case 3:    /* menunum case 3 itemnum case 3 -- Clear Screen */
  992. X        top = MINY; bot = MAXY; savx = MINX; savy = MINY;
  993. X        curmode = FS_NORMAL; inesc = -1;
  994. X        a[0] = 0; a[1] = 0; sa[0] = 0; sa[1] = 0;
  995. X        retval |= REDOUTIL;
  996. X        emit(12);
  997. X        break;
  998. X
  999. X    case 4:    /* menunum case 3 itemnum case 4 -- Echo mode */
  1000. X        if (p_echo)
  1001. X        p_echo = 0;
  1002. X        else
  1003. X        p_echo = 1;
  1004. X        retval |= REDOUTIL;
  1005. X        break;
  1006. X
  1007. X    case 5:    /* menunum case 3 itemnum case 5 -- Wrap mode */
  1008. X        if (p_wrap)
  1009. X        p_wrap = 0;
  1010. X        else
  1011. X        p_wrap = 1;
  1012. X        retval |= REDOUTIL;
  1013. X        break;
  1014. X
  1015. X    case 6:    /* menunum case 3 itemnum case 6 -- NumKey */
  1016. X        if (p_keyapp)
  1017. X        p_keyapp = 0;
  1018. X        else
  1019. X        p_keyapp = 1;
  1020. X        retval |= REDOUTIL;
  1021. X        break;
  1022. X
  1023. X    case 7:    /* menunum case 3 itemnum case 7 -- App Cur */
  1024. X        if (p_curapp)
  1025. X        p_curapp = 0;
  1026. X        else
  1027. X        p_curapp = 1;
  1028. X        retval |= REDOUTIL;
  1029. X        break;
  1030. X
  1031. X    case 8:    /* menunum case 3 itemnum case 8 -- BS <-> DEL */
  1032. X        swap_bs_del();
  1033. X        retval |= REDOUTIL;
  1034. X        break;
  1035. X
  1036. X    case 9:    /* menunum case 3 itemnum case 9 -- Xfer Beep */
  1037. X        if(p_xbeep)
  1038. X        p_xbeep = 0;
  1039. X        else
  1040. X        p_xbeep = 1;
  1041. X        retval |= REDOUTIL;
  1042. X        break;
  1043. X
  1044. X    case 10: /* menunum case 3 itemnum case 10 - Mouse Up */
  1045. X        if(p_mouse_up)
  1046. X        p_mouse_up = 0;
  1047. X        else
  1048. X        p_mouse_up = 1;
  1049. X        retval |= REDOUTIL;
  1050. X        break;
  1051. X
  1052. X    case 11: /* menunum case 3 itemnum case 11 - Mouse Down */
  1053. X        if(p_mouse_down)
  1054. X        p_mouse_down = 0;
  1055. X        else
  1056. X        p_mouse_down = 1;
  1057. X        retval |= REDOUTIL;
  1058. X        break;
  1059. X    }
  1060. X
  1061. X    break;
  1062. X    } /* end of switch ( menunum ) */
  1063. X    return retval;
  1064. X}
  1065. SHAR_EOF
  1066. echo "extracting vt100.doc"
  1067. sed 's/^X//' << \SHAR_EOF > vt100.doc
  1068. XThis is the documentation file for the VT100 terminal emulator originally
  1069. Xby Dave Wecker.  Versions 2.7-2.9 are by Tony Sumrall.  I can be reached
  1070. Xon USENET => acs@amdahl.com
  1071. X
  1072. XDave can be reached via:
  1073. X
  1074. X    Dave Wecker at    ENET:    COOKIE::WECKER
  1075. X            ARPA:    wecker%cookie.dec.com@decwrl.dec.com
  1076. X            USENET:    {decvax|decwrl}!cookie.dec.com!wecker
  1077. X            SNAIL:    Dave Wecker
  1078. X                115 Palm Springs Drive
  1079. X                Colorado Springs, CO  80908
  1080. X
  1081. XNote that Dave had NOTHING to do with this release.  Don't bother him with
  1082. Xproblem in my code.
  1083. X
  1084. X
  1085. XMANY pieces of code/suggestions have been sent in..
  1086. X
  1087. X    thanks to all!
  1088. X
  1089. XProgram startup:
  1090. X----------------
  1091. X    1> vt100 [-i | +i initfile] [ scriptfile ... ]
  1092. X
  1093. X                - -i option means don't look for an init file; +i means
  1094. X                  look for an init file of this name.  The search for the
  1095. X                  init file will be the current directory then S:.  Of
  1096. X                  course you can always override this by saying C:file if
  1097. X                  you like.  The format for the init file is described
  1098. X                  later in this document.
  1099. X
  1100. X        - The init file controls the setting of initial defaults
  1101. X          and screen and macro definitions.
  1102. X
  1103. X        - If none of the files (listed above) are found, the
  1104. X          built-in defaults (defined in VT100.C as variables,
  1105. X          beginning with "p_") are used.
  1106. X
  1107. X        - All commands are either menu or script based. Scripts
  1108. X          are described below.
  1109. X
  1110. XMenus (Commands in parenthesis are default keyboard bindings: Right-Amiga-chr):
  1111. X-----------------------------------------------------------------------
  1112. XFile                - file transfers
  1113. X    Protocol        - Sets the protocol to be used for send/rec.
  1114. X        ASCII        - use uncontrolled protocol
  1115. X        Xmodem    (A-X)    - use the ever-popular Xmodem Checksum
  1116. X        XmodemCRC    - use the in demand Xmodem CRC
  1117. X        Kermit    (A-K)    - my favorite protocol
  1118. X        .
  1119. X        .        - externally defined transfer programs
  1120. X        .
  1121. X    Send        (A-^)    - Send a file using the selected protocol
  1122. X    Receive        (A-V)    - Receive a file as above
  1123. X    Kermit Get    (A-G)    - Get files from a kermit server
  1124. X    Kermit Bye    (A-B)    - Finish with the kermit server.
  1125. X    Capture            - Log received text to a file.  Changes to
  1126. X                  Capturing when in progress
  1127. XComm Setup            - Setup communications
  1128. X    Baud Rate        - Set the terminal baud rate
  1129. X        300
  1130. X        1200    (A-L)
  1131. X        2400    (A-H)
  1132. X        4800
  1133. X        9600
  1134. X    Parity            - Type of parity
  1135. X        NONE    (A-X)
  1136. X        MARK
  1137. X        SPACE
  1138. X        EVEN    (A-E)
  1139. X        ODD    (A-O)
  1140. X    Xfer Mode
  1141. X        Image    (A-I)    - Send files verbatim (for UNIX hosts or
  1142. X                  binary files)
  1143. X        Text    (A-T)    - Send CR LF as line terminator and strip
  1144. X                  CR on received files (VMS text).
  1145. X        Convert        - Should KERMIT convert fnames to lower case
  1146. X        AutoChop    - Enable/disable AutoChop on XMODEM xfers
  1147. X    Shared            - Causes VT100 to use the serial port in shared
  1148. X                  mode (see description of the Shared script
  1149. X                  command).
  1150. X    AutoChop        - Does autochop of XMODEM received files.
  1151. XScript                - Script commands
  1152. X    Execute Macro    (A-M)    - Start up an asynchronous script file
  1153. X    Abort Execution    (A-A)    - Terminate a script file
  1154. X    AREXX Macro        - Send a command to AREXX for execution
  1155. XUtility            - Utility commands
  1156. X    Send Break    (A-.)    - send a break to the host
  1157. X    Hang Up            - close line (not implemented yet)
  1158. X    Change Dir    (A-D)    - change the local directory (for transfers)
  1159. X    Clear Scrn        - clear the screen (initial state)
  1160. X    Echo            - turn on/off half duplex mode
  1161. X    Wrap        (A-W)    - turn on/off long line wrapping mode
  1162. X    Num Key        (A-K)    - turn on/off numeric keypad mode
  1163. X    App Cur        (A-C)    - turn on/off application cursor mode
  1164. X    BS<->DEL        - swap backspace and delete keys
  1165. X    Mouse Up        - send mouse UP events
  1166. X    Mouse Dn        - send mouse DOWN events
  1167. X
  1168. XKeypad mapping (in application keypad mode):
  1169. X--------------------------------------------
  1170. X
  1171. X        AMIGA        VT100        comments
  1172. X        -------        -------        ---------------------------
  1173. X        0-9    ==    0-9
  1174. X        .    ==    .
  1175. X        ENTER    ==    ENTER        (basically, flip the bottom
  1176. X        -    ==    ,         2 keys up to get a VT100)
  1177. X        HELP    ==    -        (only free key around)
  1178. X        f1-f4    ==    PF1-PF4        (or any rebinding you do)
  1179. X        arrows    ==    arrows
  1180. X
  1181. XNote:    If you own an A500 or an A2000 and you use a "good" keymap the
  1182. X    top 4 keys of the keypad will function as the VT100 F1-F4.  This
  1183. X    that you can use the Amiga's F1-F4 for your own use and still have
  1184. X    the ability to generate the VT100 PF1-PF4.
  1185. X
  1186. X    Right AMIGA key in conjunction with a period (".") will send a
  1187. X    break to the host.
  1188. X
  1189. X    CTRL in conjunction with an at-sign ("@") a two ("2") or a
  1190. X    space (" ") will send a NULL to the host.
  1191. X
  1192. X    CTRL in conjunction with a six  ("6") will send a CTRL-^
  1193. X    CTRL in conjunction with a dash ("-") or question mark ("?")
  1194. X        will send a CTRL-_ to the host.
  1195. X
  1196. XMulti file Xfers:
  1197. X-----------------
  1198. XThe VT100 emulator supports multiple file transfers. This is
  1199. Xspecified by using a comma (",") between file names when using XMODEM
  1200. Xor KERMIT. (NOTE: host XMODEM's normally CANNOT support multiple file
  1201. Xtransfers).
  1202. X
  1203. XWhen specifying a file name to recieve by default the directory path is
  1204. Xstripped off of the filename when sent to the host but is kept for the
  1205. Xlocal file spec. eg:
  1206. X
  1207. X        receive file: ram:file.txt,df1:newfile.bin,$
  1208. X
  1209. Xwill ask the server for file.txt and put it in ram:, and get newfile.bin
  1210. Xand put it on df1: (see explanation of "$" below). If you do a single file
  1211. Xtransfer you will get another prompt for the remote name e.g.:
  1212. X
  1213. X        receive file: ram:file.txt
  1214. X        remote file name [file.txt]:  userdisk1:wantfile.txt
  1215. X
  1216. XThe same rules apply to sending multiple files therefore if you are doing
  1217. Xmulti file transfers make sure the host server is connected to the desired
  1218. Xdirectory.
  1219. X
  1220. XIn addition KERMIT supports wildcards:
  1221. X    * = any number of characters
  1222. X    ? = any single character
  1223. XExamples:
  1224. X    send:    *.c,*.h,*.doc
  1225. X    get:    *.c,*.h,$
  1226. X
  1227. XNote that in this release, wilcarded files may be sent to a KERMIT that is
  1228. X*not* in server mode (e.g. you can say "RECEIVE" to the host KERMIT and
  1229. Xsend *.c files successfully).
  1230. X
  1231. XKERMIT receive is now smart enough to use the host filename so no
  1232. Xfilename needs to be specified on the AMIGA's side (see the CONVERT option).
  1233. X
  1234. XIf your host is capable of sending or receiving long packets (packets in
  1235. Xexcess of 94 bytes) you may set p_kmaxpack to some number <= 1000.  The
  1236. Xscript command KMAXPACK can accomplish the same result.
  1237. X
  1238. XInitialization and Script file operation:
  1239. X-----------------------------------------
  1240. XAn initialization file (as described in the "Program Startup" section) may
  1241. Xcontain any of the commands shown below that have the word INIT in their
  1242. Xdescription below. Commands that are available from scripts have the word
  1243. XSCRIPT in the descriptions below. All commands may be abbreviated to 3
  1244. Xletters and are case insensitive.
  1245. X
  1246. XThe script file can be invoked by selecting 'execute file' from the script
  1247. Xmenu. At any time you can abort the script file by selecting 'Abort
  1248. XExecution'. You may also invoke a script from a function key if the first
  1249. Xcharacter of the function key definition is the KEYSCRIPT character (e.g.,
  1250. Xdefine F5 as "~df1:foo.script").
  1251. X
  1252. XDuring the time script file is running the terminal emulation is still
  1253. Xactive and you may type simulataneous to the script file. This may be
  1254. Xdesired if your script file is WAITing for a string or is DELAYing for a
  1255. Xperiod of time etc.
  1256. X
  1257. XAREXX support:
  1258. X--------------
  1259. XAREXX is supported in this release.  If an unknown command is entered and
  1260. XVT100 can successfully communicate with AREXX then VT100 will automatically
  1261. Xforward the unknown command to AREXX for execution -- AREXX will follow its
  1262. Xnormal search order.
  1263. X
  1264. XThe host name (address() in AREXX parlance) is composed of the characters
  1265. XVT100-, the name of the serial device used (i.e.  the value specified on the
  1266. XDEVICE command or the value of p_device) and the unit number (i.e. the value
  1267. Xspecified on the UNIT command or the value of p_unit).  For an unmodified
  1268. Xsystem using the serial device distributed with Workbench the hostname would
  1269. Xbe "VT100-serial.device-00".
  1270. X
  1271. XWhen you invoke an AREXX macro, AREXX will automatically search for a file
  1272. Xwhose name ends in .vt100.  For example, if you enter FOO and have an AREXX
  1273. Xmacro present named FOO.vt100, AREXX will execute it on VT100's (and your)
  1274. Xbehalf.
  1275. X
  1276. XIf for some reason a path to AREXX cannot be established on startup, VT100 will
  1277. XNOT attempt to send unknown commands to AREXX.  The user can force a retry by
  1278. Xusing the RX command or the RX menu item.
  1279. X
  1280. XAll AREXX macros run by VT100 run asynchronously with other work including
  1281. Xscripts and other AREXX macros.  Be aware of this -- you could surprise
  1282. Xyourself!
  1283. X
  1284. XThe is one special command, FORWARD, which can only be used by issuing it from
  1285. Xan AREXX macro.  This command allows an AREXX user to request that all data
  1286. Xreceived from the serial port be forwarded to a port for inspection.  Heavy use
  1287. Xof this facility will cause VT100 to slow down considerably!  Use it with
  1288. Xcaution!  This command does, however, provide some substantial benefits.  Most
  1289. Xnotable amongst those are the ability to effectively write a multi-way ON
  1290. Xcommand.  See the sample AREXX macros packaged with the distribution.
  1291. X
  1292. XScript commands will return a return code to the invoking AREXX script.  AREXX
  1293. Xautomatically places this value into the special variable RC.  The values
  1294. Xreturned are listed in vt100.h and are explained here:
  1295. XCMDOK    - Command executed OK
  1296. XCMDWARN    - Command issued a WARNING message but completed in some fashion
  1297. XCMDBS    - Command is invalid for current state (e.g. INIT only)
  1298. XCMDNF    - Command not found (i.e. invalid command)
  1299. XCMDFAIL    - Command failed completely.
  1300. X
  1301. XInitialization and Script file Commands:
  1302. X----------------------------------------
  1303. X#    Commented line                    (INIT,SCRIPT)
  1304. X    Format:
  1305. X    # This line is a comment
  1306. X--------------------------------------------------------------------------
  1307. XAPPCUR    Set the application cursor mode            (INIT,SCRIPT)
  1308. X    Format:
  1309. X    APPCUR    ON/OFF or YES/NO
  1310. X--------------------------------------------------------------------------
  1311. XASCII_SEND Send an ascii file to the host.        (SCRIPT)
  1312. X    Format:
  1313. X    (same format as CAPTURE)
  1314. X--------------------------------------------------------------------------
  1315. XAUTOCHOP Enable/disable XMODEM auto-chop        (INIT, SCRIPT)
  1316. X    Format:
  1317. X    AUTOCHOP    ON/OFF or YES/NO
  1318. X--------------------------------------------------------------------------
  1319. XBACKGROUND Define a background color            (INIT)
  1320. X    Format:
  1321. X    BACKGROUND hex        three digit hex number
  1322. X    Example:
  1323. X    BACKGROUND F00        bright red background
  1324. X--------------------------------------------------------------------------
  1325. XBAUD    Set baud rate                    (INIT,SCRIPT)
  1326. X    Format:
  1327. X    BAUD rate        Sets the baud rate for send/receive
  1328. X    Example:
  1329. X    BAUD 2400        Sets the baud rate at 2400 baud
  1330. X--------------------------------------------------------------------------
  1331. XBEEP    Beep at the console                (SCRIPT)
  1332. X    Format:
  1333. X    BEEP
  1334. X--------------------------------------------------------------------------
  1335. XBOLD    Define a color for bold                (INIT)
  1336. X    Format:
  1337. X    (same as BACKGROUND)
  1338. X--------------------------------------------------------------------------
  1339. XBREAK    Set the break time (for an SB command)        (INIT,SCRIPT)
  1340. X    Format:
  1341. X    BREAK value        Value is in micro-seconds
  1342. X    Example:
  1343. X    BREAK 750000
  1344. X--------------------------------------------------------------------------
  1345. XBUFFER    Set transmission buffer size            (INIT)
  1346. X    Format:
  1347. X    BUFFER n        Number of bytes to buffer
  1348. X    Example:
  1349. X    BUFFER 512
  1350. X--------------------------------------------------------------------------
  1351. XCAPTURE    To start/stop ascii file capture.        (SCRIPT)
  1352. X    Format:
  1353. X    CAPTURE    file        Start ascii capturing
  1354. X    CAPTURE            End ascii capturing
  1355. X--------------------------------------------------------------------------
  1356. XCD    To change the local directory            (SCRIPT)
  1357. X    Format:
  1358. X    CD    newdir        set a new directory for file transfers
  1359. X    Example:
  1360. X    CD    DF1:foo/bar    set the directory as specified
  1361. X--------------------------------------------------------------------------
  1362. XCONVERT    Tell KERMIT whether or not to convert filenames    (INIT,SCRIPT)
  1363. X    Format:
  1364. X    CONVERT    ON/OFF or YES/NO
  1365. X    Example:
  1366. X    CONVERT    ON        Filenames will be down cased
  1367. X--------------------------------------------------------------------------
  1368. XCURSOR    Define a color for the cursor            (INIT)
  1369. X    Format:
  1370. X    (same as BACKGROUND)
  1371. X--------------------------------------------------------------------------
  1372. XDELAY    Suspends script file for a specified time    (SCRIPT)
  1373. X    Format:
  1374. X    DELAY    n        Suspends execution for n seconds
  1375. X    Example:
  1376. X    DELAY    2        Suspends for 2 seconds
  1377. X--------------------------------------------------------------------------
  1378. XDEPTH    Define the depth of the window/screen        (INIT)
  1379. X    Format:
  1380. X    DEPTH n        Number of planes in window/screen
  1381. X    Example:
  1382. X    DEPTH 1        Minimum depth
  1383. X    DEPTH 2        Same as Workbench
  1384. X--------------------------------------------------------------------------
  1385. XDEVICE    Define name of serial device handler to use    (INIT)
  1386. X    Format:
  1387. X    DEVICE name    Sets name of serial device handler to name
  1388. X    Example:
  1389. X    DEVICE newser.device    Set name of serial device handler to
  1390. X                newser.device
  1391. X    DEVICE serial.device    Set name of serial device handler to the
  1392. X                "default" (i.e. the C-A supplied device)
  1393. X--------------------------------------------------------------------------
  1394. XDISPLAY    Display data on the screen            (SCRIPT)
  1395. X    Format:
  1396. X    DISPLAY string    Displays string on the screen as though received from
  1397. X            the serial port (including escape sequence handling)
  1398. X    Example:
  1399. X    DISPLAY ^M        Causes VT100 to act as though a carriage-return
  1400. X                were received over the serial port.
  1401. X    DISPLAY "^[[M"        Deletes the current line on the screen.
  1402. X    DISPLAY "Move^[[Aup one line"    Displays "Move" on the current line on
  1403. X                the screen then moves the cursor up one line
  1404. X                displays "up one line".
  1405. X--------------------------------------------------------------------------
  1406. XECHO    Turn on/off local echo                (INIT,SCRIPT)
  1407. X    Format:
  1408. X    ECHO    ON/OFF or YES/NO
  1409. X    Example:
  1410. X    ECHO    ON        Half duplex mode
  1411. X--------------------------------------------------------------------------
  1412. XEXIT    Ends execution of the current script file.    (INIT,SCRIPT)
  1413. X    Format:
  1414. X    EXIT            Exit the current script/init file
  1415. X    EXIT VT100        Exit vt100 program (from SCRIPT only)
  1416. X    EXIT newscript        Exit this file and start up newscript
  1417. X    Example:
  1418. X    EXIT DF1:FOO.BAR    Exit the current file and start FOO.BAR
  1419. X--------------------------------------------------------------------------
  1420. XEXTERNAL    Define external transfer program    (INIT,SCRIPT)
  1421. X    Format:
  1422. X    EXTERNAL "mode-name" "send-pgm" "receive-pgm"
  1423. X                Send-pgm and receive-pgm may contain the strings
  1424. X                @LOCAL and @REMOTE which will cause VT100 to put
  1425. X                up a requester asking for local and/or remote
  1426. X                filenames.  These will be substituted in place
  1427. X                of their respective parameters in the send-pgm
  1428. X                and/or receive-pgm prior to invoking it/them.
  1429. X                See also the description of the SHARE command.
  1430. X    Examples:
  1431. X    EXTERNAL "FOO" "foo baz" "baz foo"
  1432. X                Define external transfer program which will
  1433. X                be called FOO in the MODE menu.  Invoke foo
  1434. X                passing baz to SEND files, invoke baz passing
  1435. X                foo to RECEIVE files.
  1436. X    EXTERNAL "FOO" "foo @REMOTE baz" "baz @LOCAL @REMOTE foo"
  1437. X                As above but display a requester for the remote
  1438. X                filename (in the case of send) or both the
  1439. X                local and remote filenames (in the case of
  1440. X                receive).  The name(s) used to satisfy the
  1441. X                requester(s) will be replaced in the parameter
  1442. X                string to the appropriate program prior to
  1443. X                its invocation.
  1444. X    EXTERNAL FOO        Remove definition of transfer pgm FOO
  1445. X--------------------------------------------------------------------------
  1446. XF    Define a function key or the mouse prefix    (INIT,SCRIPT)
  1447. X    Format:
  1448. X    F n string        Define Function key n to be string
  1449. X    F M string        Define the mouse prefix (the prefix sent to
  1450. X                the host when a mouse button is used AND
  1451. X                events are selected via the MOUSE command
  1452. X    Example:    (see SEND for string format)
  1453. X    F 1 "dir^M"        Define F1 is the string dir<cr>
  1454. X    F 11 "help"        Define Shifted F1 as the string help
  1455. X    F 20 ^C            Define Shifted F10 as a control-C
  1456. X    F M "^[O"        Send ESC-O before mouse data
  1457. X--------------------------------------------------------------------------
  1458. XFONT Specify font to use                (INIT)
  1459. X    Format:
  1460. X    FONT font-name
  1461. X    Example:
  1462. X    FONT point-font
  1463. X--------------------------------------------------------------------------
  1464. XFONTSIZE Specify font size to use            (INIT)
  1465. X    Format:
  1466. X    FONTSIZE font-size
  1467. X    Example:
  1468. X    FONTSIZE 8
  1469. X--------------------------------------------------------------------------
  1470. XFOREGROUND Define a color for the foreground        (INIT)
  1471. X    Format:
  1472. X    (same as BACKGROUND)
  1473. X--------------------------------------------------------------------------
  1474. XFORWARD Forward received data to an AREXX port        (REXXONLY)
  1475. X    Format:
  1476. X    FORWARD portname
  1477. X    Example:
  1478. X    FORWARD REXX-VT100    Sends received data to a port named
  1479. X                REXX-VT100.  This command can (and probably
  1480. X                WILL) cause you to GURU if you remove the
  1481. X                port before you tell VT100 to quit
  1482. X                forwarding data.
  1483. X    FORWARD            Tells VT100 to quit forwarding data
  1484. X--------------------------------------------------------------------------
  1485. XGOTO    Jumps to a different part of the script file.    (SCRIPT,NONREXX)
  1486. X    Format:
  1487. X    GOTO label        Jumps to a line beginning with label:.
  1488. X                Jumps may be forward or backward.
  1489. X    Example:
  1490. X    FOO:            Sets up a label
  1491. X    ...
  1492. X    GOTO FOO        Jumps to FOO
  1493. X--------------------------------------------------------------------------
  1494. XINTERLACE Turn on/off interlace                (INIT)
  1495. X    Format:
  1496. X    INTERLACE ON/OFF or YES/NO or ASIS
  1497. X    Example:
  1498. X    INTERLACE ON        Use interlacing
  1499. X    INTERLACE ASIS        Use interlace if WBSCREEN uses it
  1500. X--------------------------------------------------------------------------
  1501. XKB    Send a BYE packet to a host KERMIT server.    (SCRIPT)
  1502. X    Format:
  1503. X    KB            Shut down server.
  1504. X--------------------------------------------------------------------------
  1505. XKEYSCRIPT Define a new keyscript character        (INIT,SCRIPT)
  1506. X    Format:
  1507. X    KEYSCRIPT hex        New character in hex
  1508. X    Example:
  1509. X    KEYSCRIPT 7E        Use "~" as the new character
  1510. X--------------------------------------------------------------------------
  1511. XKG    Gets files from host.                (SCRIPT)
  1512. X    Format:
  1513. X    (same format as KS)     Get from server
  1514. X--------------------------------------------------------------------------
  1515. XKMAXPACK Set maximum packet size for kermit transfers    (INIT,SCRIPT)
  1516. X    Format:
  1517. X    KMAXPACK n        Set maximum packet size to n
  1518. X    Example:
  1519. X    KMAXPACK 1000        Use long packets if possible.  Don't forget
  1520. X                to increase the send/receive timeout values
  1521. X                on your host!!!
  1522. X--------------------------------------------------------------------------
  1523. XKR    Receives a file from kermit host.        (SCRIPT)
  1524. X    Format:
  1525. X    (same format as KS)     Not from a server
  1526. X--------------------------------------------------------------------------
  1527. XKS    Sends files via kermit to the host.        (SCRIPT)
  1528. X    Format:
  1529. X    KS file            Send one file
  1530. X    KS file1,file2,...    Send multiple files
  1531. X    KS file1,file2,...,$    Send multiple files and shut down server
  1532. X    Example:
  1533. X    KS foo.bar        sends foo.bar (note no quoting is used)
  1534. X    KS foo1,foo2,foo3    sends three files
  1535. X    KS foo1,foo2,foo3,$    sends three files and shuts down server
  1536. X--------------------------------------------------------------------------
  1537. XLINES    Define number of lines in the window        (INIT)
  1538. X    Format:
  1539. X    LINES n
  1540. X    Example:
  1541. X    LINES 24        Maximum for non-interlace
  1542. X    LINES 48        Maximum for interlaced
  1543. X    LINES 0            Determine the maximum number of lines
  1544. X                available and use it
  1545. X--------------------------------------------------------------------------
  1546. XMODE    Set a transfer mode for KERMIT to use        (INIT,SCRIPT)
  1547. X    Format:
  1548. X    MODE type        type of transfers to perform
  1549. X    Example:
  1550. X    MODE IMAGE        image mode transfers
  1551. X    MODE CRLF        <CR><LF> text transfers (VMS Kermit).
  1552. X--------------------------------------------------------------------------
  1553. XMOUSE    Enable reporting of mouse events to the host    (INIT,SCRIPT)
  1554. X    Format:
  1555. X    MOUSE BOTH/UP/DOWN/OFF
  1556. X    Example:
  1557. X    MOUSE OFF        Send no mouse events
  1558. X    MOUSE BOTH        Send both mouse up and down events
  1559. X--------------------------------------------------------------------------
  1560. XMSG    Cause VT100 to display a message        (SCRIPT)
  1561. X    Format:
  1562. X    MSG string    If string ends with a ^M then string will be displayed
  1563. X            and a subsequent MSG will overlay string.  If string
  1564. X            contains ^J then the text up to the ^J will be
  1565. X            displayed followed by a new-line followed by the
  1566. X            remainder of the text of string.
  1567. X    Example:    (see SEND for string format)
  1568. X    MSG "Show me this msg^J" Will display "Show me this msg" with a
  1569. X                following new-line in the VT100 Info window.
  1570. X                A subsequent MSG will overlay the text of this
  1571. X                message.
  1572. X
  1573. X    MSG "Show me^Mthis msg" Will display "Show me this msg" with a
  1574. X                new-line after the words "me" and "msg".
  1575. X
  1576. X                See the SEND command for a more complete
  1577. X                definition of string.
  1578. X--------------------------------------------------------------------------
  1579. XNUMKEY    Numeric keypad mode                (INIT,SCRIPT)
  1580. X    Format:
  1581. X    NUMKEY    ON/OFF or YES/NO
  1582. X    Example:
  1583. X    NUMKEY    ON        Keypad is pure numbers
  1584. X--------------------------------------------------------------------------
  1585. XON    Peforms a command every time string is received    (SCRIPT)
  1586. X    Format:
  1587. X    ON      "string"  cmd    Execute cmd when string is received.
  1588. X                Only one ON string may be installed at a
  1589. X                time.
  1590. X
  1591. X                If cmd is a GOTO and we were previously
  1592. X                WAITing for a string the WAIT is aborted
  1593. X                and execution resumes at the new label.
  1594. X
  1595. X                If cmd is not SEND and we were previously
  1596. X                DELAYing, then the DELAY is aborted and the
  1597. X                cmd is executed, followed by the next
  1598. X                command after the DELAY.
  1599. X
  1600. X                If cmd is a SEND and we were previously
  1601. X                DELAYing, then the DELAY is continued.
  1602. X
  1603. X                If cmd is NULL (i.e. ON "") then the
  1604. X                current ON command is aborted.
  1605. X    Example:
  1606. X    ON  "LOSS CARRIER" GOTO RESTART
  1607. X                If modem drops carrier, try to redial
  1608. X    ON  "--more--" SEND " "
  1609. X                Send a space every time --more-- is received
  1610. X--------------------------------------------------------------------------
  1611. XPARITY    Sets the parity                    (INIT,SCRIPT)
  1612. X    Format:
  1613. X    PARITY    type        Set the parity type
  1614. X                Note that all received characters that are
  1615. X                destined for the screen are subject to
  1616. X                having their parity bits removed or left
  1617. X                alone depending on the PARITY setting.
  1618. X                Versions prior to 2.9 did not do this.  I
  1619. X                corrected this bug but you should be aware
  1620. X                that old scripts that depended on this
  1621. X                incorrect behaviour will probably break.
  1622. X                If, for example, you are connected to a
  1623. X                host which uses MARK parity but you
  1624. X                PARITY NONE you will most likely never
  1625. X                match an ON string.
  1626. X    Example:
  1627. X    PARITY    NONE        no parity
  1628. X    PARITY    MARK        mark parity
  1629. X    PARITY    SPACE        space parity
  1630. X    PARITY    ODD        odd parity
  1631. X    PARITY    EVEN        even parity
  1632. X--------------------------------------------------------------------------
  1633. XRECF    Receive a file using the protocol specified in XPROTO    (SCRIPT)
  1634. X    Format:
  1635. X    RECF file-spec
  1636. X    Example:
  1637. X    XPROTO XMODEMCRC    Select XMODEM CRC protocol
  1638. X    RECF Foo        Receive Foo using XMODEM CRC
  1639. X--------------------------------------------------------------------------
  1640. XRX    Send a command to AREXX for processing        (INIT,SCRIPT)
  1641. X    Format:
  1642. X    RX    command args    Send command and args to AREXX
  1643. X    Example:
  1644. X    RX TRACE NOTHING    Cause AREXX to execute TRACE.VT100 passing
  1645. X                one parameter ("NOTHING").
  1646. X
  1647. X                Note that it is normally unneccessary to use
  1648. X                this command in other cases since VT100 will
  1649. X                automatically route unknown commands to AREXX
  1650. X                for processing.  However, if VT100 cannot
  1651. X                communicate with AREXX at startup it will NOT
  1652. X                automatically send cmds to AREXX and this
  1653. X                command must be used.  In the normal case,
  1654. X                though, this command will be used as the cmd
  1655. X                option in an ON command.  Also note that AREXX
  1656. X                macros are run asynchronously...you may get
  1657. X                results that you don't expect so think about it
  1658. X                if you want to try to run two or more AREXX
  1659. X                macros sequentially.
  1660. X
  1661. X                See the section, above, on AREXX.
  1662. X
  1663. X    Example:
  1664. X    ON "gin:" rx login acs    When "gin:" is received invoke the AREXX
  1665. X                script login.vt100 passing 1 parameter:
  1666. X                acs.
  1667. X--------------------------------------------------------------------------
  1668. XSB    Sends a break character to the host        (SCRIPT)
  1669. X    Format:            Note that any pending character to send
  1670. X    SB                is aborted by this call
  1671. X--------------------------------------------------------------------------
  1672. XSCREEN    Define the screen type                (INIT)
  1673. X    Format:
  1674. X    SCREEN type        type of screen to use
  1675. X    Example:
  1676. X    SCREEN WORKBENCH    use the workbench screen
  1677. X    SCREEN CUSTOM        use a custom screen
  1678. X--------------------------------------------------------------------------
  1679. XSEND    Sends a string or character to the host.    (SCRIPT)
  1680. X    Format:
  1681. X    SEND    "string"    Sends a string to the host. Beginning and
  1682. X                ending double quotes (") are required. A
  1683. X                carat (^) may be used to send control chars.
  1684. X                Two carats transmits a carat character.  Two
  1685. X                imbedded double quotes will send a one double
  1686. X                quote.
  1687. X        SEND    chr        Sends a single character.
  1688. X        SEND    ^chr        Sends a single control character. The chr
  1689. X                is NOT case sensitve
  1690. X    Example:
  1691. X    SEND    "mail"        Send the string mail
  1692. X    SEND    "dir^M"        Send the string dir followed by a <CR>
  1693. X    SEND    a        Send the letter a
  1694. X    SEND    ^C        Send a control C
  1695. X    SEND    "abc^^def"    Send the string abc^def
  1696. X    SEND    ^^        Send a control-uparrow
  1697. X    SEND    "        Send the '"' character
  1698. X--------------------------------------------------------------------------
  1699. XSENDF Send a file using the protocol specified in XPROTO    (SCRIPT)
  1700. X    Format:
  1701. X    SENDF file-spec
  1702. X    Example:
  1703. X    XPROTO XMODEMCRC    Select XMODEM CRC protocol
  1704. X    SENDF Foo        Send Foo using XMODEM CRC
  1705. X--------------------------------------------------------------------------
  1706. XSHARE Use the serial port in shared or exclusive mode        (INIT,SCRIPT)
  1707. X    Format:
  1708. X    SHARE ON/OFF or YES/NO    If ON or YES other programs that open the
  1709. X                serial port in shared mode may be used
  1710. X                (possibly via the EXTERNAL command.  If OFF
  1711. X                or NO is specified then no other program may
  1712. X                use the serial port while VT100 has it open.
  1713. X                VT100 will close the serial port if SHARE
  1714. X                OFF is specified and an EXTERNAL protocol
  1715. X                routine is invoked and then re-open it once
  1716. X                the protocol module is done.
  1717. X    Example:
  1718. X    SHARE ON        Open the serial port in shared mode
  1719. X    SHARE NO        Open the serial port in exclusive mode
  1720. X--------------------------------------------------------------------------
  1721. XSHORTCUT set a new shortcut command key          (INIT)
  1722. X    Format:
  1723. X    SHORTCUT cmd key        Sets key "key" to be the shortcut key for
  1724. X                                script command "cmd".  A null key will
  1725. X                                cause no shortcut to be available for this
  1726. X                                command (menu-option).  Cmd may be one of
  1727. X                                the following:
  1728. X              >> File items:   <<
  1729. X    SE    - Send file using XPROTO    RE    - Receive file using XPROTO
  1730. X    KG    - kermit get file        KB    - kermit bye (for server)
  1731. X    CAP    - ascii capture on/off
  1732. X              >> Mode (XPROTO) items: <<
  1733. X    ASC - ASCII "protocol"        XM    - XMODEM protocol
  1734. X    XMC    - XMODEM CRC protocol        KE    - Kermit protocol
  1735. X              >> Comm items:   <<
  1736. X    300     - Set Baud 300             1200    - Set Baud 1200
  1737. X    2400    - Set Baud 2400            4800    - Set Baud 4800
  1738. X    9600    - Set Baud 9600            NONE    - Set Parity none
  1739. X    MARK    - Set Parity mark          SPACE    - Set Parity space
  1740. X    EVEN    - Set Parity even          ODD    - Set Parity odd
  1741. X    IMAGE   - KERMIT transfer mode     TEXT    - KERMIT transfer mode
  1742. X    CONVERT - KERMIT transfer mode     AUTOCHOP    - Enable/disable XMODEM
  1743. X                          auto-chop feature
  1744. X              >> Script items: <<
  1745. X    EXECUTE - execute macro        ABORT    - abort macro
  1746. X    RX      - send AREXX command
  1747. X              >> Util items:   <<
  1748. X    SB      - send break        HANG    - hang up
  1749. X    CD      - change directory        CLEAR    - clear screen
  1750. X    ECH     - turn echo on or off    WRAP    - turn wrap on or off
  1751. X    NUMKEY  - turn numeric kpad on/off    APP    - turn app. cursor on/off
  1752. X    CON     - convert bs to del        SWAP    - Swap BS and DEL
  1753. X    MOUSEUP - send mouse UP events    MOUSEDN    - send mouse DOWN events
  1754. X
  1755. X    Example:
  1756. X    SHORTCUT ASC Q          set Right-Amiga-Q to be the shortcut for
  1757. X                                ASCII_SEND.
  1758. X    SHORTCUT XS             removes the shortcut key for sending via
  1759. X                                XMODEM protocol
  1760. X--------------------------------------------------------------------------
  1761. XSWAP    Swap the meanings of backspace and delete keys    (INIT,SCRIPT)
  1762. X    Format:
  1763. X    SWAP ON/OFF or YES/NO
  1764. X    Example:
  1765. X    SWAP NO        Use standard definitions
  1766. X--------------------------------------------------------------------------
  1767. XUNIT    Set unit of serial device to use        (INIT)
  1768. X    Format:
  1769. X    UNIT n
  1770. X    Example:
  1771. X    UNIT 1        Open unit 1 of the serial device.  Generally the
  1772. X            user will want to specify unit 0.  When multi-port
  1773. X            serial cards become available specify as necessary.
  1774. X            See also DEVICE.
  1775. X--------------------------------------------------------------------------
  1776. XVOLUME    Set the BELL volume                (INIT)
  1777. X    Format:
  1778. X    VOLUME n
  1779. X    Example:
  1780. X    VOLUME 0        Use a visual bell
  1781. X    VOLUME 64        Use a loud audible bell
  1782. X--------------------------------------------------------------------------
  1783. XWAIT    Suspends until a certain string is received.    (SCRIPT,NONREXX)
  1784. X    Format:
  1785. X    WAIT    "string"    Same rules for string as SEND
  1786. X    WAIT            Enter an endless wait. Usually used after
  1787. X                some "ON" commands have been set up. Can
  1788. X                still be aborted via the script menu.
  1789. X    Example:
  1790. X    WAIT    "User:"        Waits for the string User:
  1791. X--------------------------------------------------------------------------
  1792. XWBCOLORS Force usage of workbench colors        (INIT)
  1793. X    Format:
  1794. X    WBCOLORS ON/OFF or YES/NO
  1795. X    Example:
  1796. X    WBCOLORS YES        Workbebch colors will be used for all
  1797. X--------------------------------------------------------------------------
  1798. XWRAP    Set long line wrapping                (INIT,SCRIPT)
  1799. X    Format:
  1800. X    WRAP    ON/OFF or YES/NO
  1801. X    Example:
  1802. X    WRAP    ON        Long lines will wrap
  1803. X--------------------------------------------------------------------------
  1804. XXBEEP    Beep at end of xfer                (INIT,SCRIPT)
  1805. X    Format:
  1806. X    XBEEP    ON/OFF or YES/NO
  1807. X    Example:
  1808. X    XBEEP    ON        Beep when xfers are finished
  1809. X--------------------------------------------------------------------------
  1810. XXPROTO    Set default transfer protocol            (INIT,SCRIPT)
  1811. X    Format:
  1812. X    XPROTO    XMODEM/XMODEMCRC/KERMIT/an external protocol
  1813. X    Example:
  1814. X    XPROTO    KERMIT        Sets transfer protocol to Kermit
  1815. X--------------------------------------------------------------------------
  1816. XXR    Receives a file via XMODEM.            (SCRIPT)
  1817. X    Format:
  1818. X    (same format as KS)
  1819. X--------------------------------------------------------------------------
  1820. XXS    Sends a file via XMODEM.            (SCRIPT)
  1821. X    Format:
  1822. X    (same format as KS)
  1823. X--------------------------------------------------------------------------
  1824. X
  1825. X
  1826. X----------------------------
  1827. XInitialization file example:
  1828. X----------------------------
  1829. X
  1830. X#####################################################################
  1831. X#
  1832. X#    VT100 sample initialization file
  1833. X#    v2.9 ?????? ACS
  1834. X#
  1835. X# Hash mark at the beginning of a line denotes a comment.
  1836. X# White space (space(s) or tab(s)) delimit fields.
  1837. X# Case ignored except for function key bindings.
  1838. X#
  1839. X# All items in this file overide variables of the same name in VT100.C
  1840. X# (all variables in vt100.c have a "p_" prepended to them)
  1841. X#
  1842. X#####################################################################
  1843. X#
  1844. XAPPCUR        ON        # Application keypad mode is being used
  1845. XAUTOCHOP    ON        # Allow XMODEM to strip NULL or ^Z from EOF
  1846. XBACKGROUND    000        # Colors are in hex RGB from 000 to FFF
  1847. XBAUD        2400        # Anything after required fields is ignored
  1848. XBOLD        a00        # Color for bold highlighting (in custom)
  1849. XBREAK        750000        # Break time in micro-seconds
  1850. XBUFFER        512        # 512 <= Input buffer size <= 2048
  1851. XCONVERT        ON        # KERMIT should downcase host names
  1852. XCURSOR        00a        # Color for cursor (in custom screen)
  1853. XDEPTH        1        # number of bit planes to use (1 or 2)
  1854. XECHO        OFF        # Full duplex mode in use
  1855. XFONT        MyFont        # Use my own special 8-point font
  1856. XFOREGROUND    950        # Colors are only used on the custom screen
  1857. XINTERLACE    ON        # ON for CUSTOM or interlaced workbench
  1858. XKEYSCRIPT    7E        # Hex value for script introducer
  1859. XLINES        0        # normal <= 24 interlaced <= 48 or 0
  1860. XMODE        CRLF        # IMAGE or CRLF (for KERMIT transfers)
  1861. XNUMKEY        ON        # The keypad should be numeric
  1862. XPARITY        NONE        # NONE (= 8 bit), MARK, SPACE, ODD or EVEN
  1863. XSCREEN        CUSTOM        # may be CUSTOM or WORKBENCH
  1864. XSWAP        OFF        # Don't Swap the Back-space and Delete keys
  1865. XVOLUME        64        # Beep Volume (0 = Visual Beep)
  1866. XWBCOLORS    YES        # ignore custom colors and use defaults
  1867. XWRAP        OFF        # Auto wrap ON or OFF
  1868. XXBEEP        ON        # Beep when xfer is done
  1869. XXPROTO        XMODEMCRC    # Send/Receive will use Xmodem CRC.
  1870. X#   Remove the shortcut key for the CD command.  No comment on next line
  1871. X# as it will be taken as the shortcut key.
  1872. XSHORTCUT        CD
  1873. X#
  1874. X# Function bindings (strings to type when any of F1 - F10 are pressed)
  1875. X#    f <num>        = function key
  1876. X#    f <num>+10    = shifted function key
  1877. X#
  1878. X# The string specified must be the same format as the SEND command:
  1879. X#    ^    = control next character
  1880. X#    ^^    = up arrow
  1881. X#
  1882. X# Sample control characters:
  1883. X#    ^[    = escape    ^M    = carriage return
  1884. X#    ^J    = line feed    ^L    = form feed
  1885. X#
  1886. X# If the first character of the string is a script introducer
  1887. X# (KEYSCRIPT) then the string is interpreted as a script filename
  1888. X# to be executed when the key is pressed.
  1889. X#
  1890. X# Examples of bindings:
  1891. X#
  1892. Xf 1    "^[OP"            # f1-f4 = PF1 - PF4 on a VT100
  1893. Xf 2    "^[OQ"
  1894. Xf 3    "^[OR"
  1895. Xf 4    "^[OS"
  1896. X#
  1897. X# f5,6,7 = scripts to execute (assuming that KEYSCRIPT = '~' = 0x7E)
  1898. X#
  1899. Xf 5    "~df1:vt100_source/dialwork.script"
  1900. Xf 6    "~df1:vt100_source/sendvt100.script"
  1901. Xf 7    "~df1:vt100_source/getpics.script"
  1902. X#
  1903. Xf 8    "MAIL^M"        # Reads my mail (note embedded <CR>)
  1904. Xf 9    "NOTE^M"        # Reads conferences
  1905. Xf 11    "ATdt415-595-2479^M"    # dials the FAUG BBS
  1906. X#
  1907. X# all done with init, now execute script as startup sequence
  1908. X#
  1909. Xexit df1:vt100_source/dialwork.script
  1910. X
  1911. X--------------------
  1912. XScript file example:
  1913. X--------------------
  1914. X
  1915. X###################################################################
  1916. X# Script to dial work (dialwork.script)
  1917. X#    v2.6    870222    DBW
  1918. X###################################################################
  1919. X#
  1920. X# Make sure that we have all the parameters we want
  1921. X#
  1922. X    DELAY    2
  1923. X    BAUD    2400
  1924. X    PARITY    NONE
  1925. X    MODE    CRLF
  1926. X    BREAK    750000
  1927. X    SB
  1928. X#
  1929. X# First get the modem's attention:
  1930. X#
  1931. XStart:
  1932. X    DELAY 1
  1933. X    ON "Ready" GOTO Dial
  1934. X    SEND ^B
  1935. X    DELAY 2
  1936. X    GOTO Start
  1937. X#
  1938. X# Now dial the 2400 baud line to work:
  1939. X#
  1940. XDial:
  1941. X    ON "Attached" GOTO Login
  1942. X    SEND "$2400!"
  1943. X    DELAY 30
  1944. X    GOTO Start
  1945. X#
  1946. X# We got attached, so keep hitting return until the Gandalf terminal
  1947. X# handler wakes up:
  1948. X#
  1949. XLogin:
  1950. X    ON "enter" GOTO Gandalf
  1951. X    DELAY 1
  1952. X    SEND ^M
  1953. X    GOTO Login
  1954. X#
  1955. X# Now connect from the Gandalf to the terminal server (ts2):
  1956. X# (when it asks for a password I need to type the password 
  1957. X# manually here)
  1958. X#
  1959. XGandalf:
  1960. X    DELAY 2
  1961. X    SEND "ts2^M"
  1962. X    WAIT "class start"
  1963. X#
  1964. X# Keep sending <CR>'s until the LAT prompts for a username:
  1965. X#
  1966. XWaitLat:
  1967. X    DELAY 2
  1968. X    ON "username>" GOTO Lat
  1969. X    SEND ^M
  1970. X    GOTO WaitLat
  1971. X#
  1972. X# Tell the LAT that it's me, and connect to the "cookie cluster"
  1973. X# (my host systems). Tell the cluster my user name.
  1974. X# (when it asks for a password I need to type the password
  1975. X# manually here)
  1976. X#
  1977. XLat:
  1978. X    SEND "wecker^M"
  1979. X    DELAY 1
  1980. X    SEND "connect cookie^M"
  1981. X    WAIT "Username:"
  1982. X    SEND "WECKER^M"
  1983. X    WAIT "at home"
  1984. X    SEND "^M^Mn^M"
  1985. X#
  1986. X# Got through all the LOGIN garbage, so let's do some work.
  1987. X#
  1988. X    WAIT "$ "
  1989. X#
  1990. X# All done so stop:
  1991. X#
  1992. X    EXIT
  1993. SHAR_EOF
  1994. echo "End of archive 8 (of 9)"
  1995. # if you want to concatenate archives, remove anything after this line
  1996. exit
  1997.